'use strict'

const Controller = require('egg').Controller;

class dlqcenter extends Controller {
    async index() {
        const data = await this.ctx.service.dlqcenter.findAll(this.ctx);
        this.ctx.body = data;
    }
    async indexOrder() {
        const data = await this.ctx.service.dlqcenter.findAllOrder(this.ctx);
        this.ctx.body = data;
    }
    async indexMygoods() {
        const data = await this.ctx.service.dlqcenter.findAllMygoods(this.ctx);
        this.ctx.body = data;
    }
    async indexMyinvitation() {
        const data = await this.ctx.service.dlqcenter.findAllMyinvitation(this.ctx);
        this.ctx.body = data;
    }
    async indexFans() {
        const data = await this.ctx.service.dlqcenter.findAllFans(this.ctx);
        this.ctx.body = data;
    }
    async indexAutoreply() {
        const data = await this.ctx.service.dlqcenter.findAllAutoreply(this.ctx);
        this.ctx.body = data;
    }
    async show() {
        const ctx = this.ctx;
        const userId = ctx.params.id;
        const user = await this.ctx.service.dlqcenter.find(userId);
        ctx.body = user;
    }
    async showOther() {
        const ctx = this.ctx;
        const userId = ctx.params.id;
        const user = await this.ctx.service.dlqcenter.findOther(userId);
        ctx.body = user;
    }
    async create() {
        const ctx = this.ctx;
        const params = ctx.request.body;
        const data = await ctx.service.dlqcenter.create(params);
        ctx.body = data;
    }
    async destroy() {
        const ctx = this.ctx;
        const userId = ctx.params.id;
        const del = await ctx.service.dlqcenter.delete(userId);
        ctx.body = del;
    }
    async update() {
        const ctx = this.ctx;
        const userId = ctx.params.id;
        const params = ctx.request.body;
        const change = await ctx.service.dlqcenter.update(userId, params);
        ctx.body = change;
    }
    async updateFans() {
        const ctx = this.ctx;
        // const userId = ctx.params.id;
        const params = ctx.request.body;
        const change = await ctx.service.dlqcenter.updateFans(params);
        ctx.body = change;
    }
    async updateReplyChange() {
        const ctx = this.ctx;
        // const userId = ctx.params.id;
        const params = ctx.request.body;
        const change = await ctx.service.dlqcenter.updateReplyChange(params);
        ctx.body = change;
    }
    async updateReply() {
        const ctx = this.ctx;
        // const userId = ctx.params.id;
        const params = ctx.request.body;
        const change = await ctx.service.dlqcenter.updateReply(params);
        ctx.body = change;
    }
    async updatePassword() {
        const ctx = this.ctx;
        // const userId = ctx.params.id;
        const params = ctx.request.body;
        const change = await ctx.service.dlqcenter.updatePassword(params);
        ctx.body = change;
    }
    async updatePhone() {
        const ctx = this.ctx;
        // const userId = ctx.params.id;
        const params = ctx.request.body;
        const change = await ctx.service.dlqcenter.updatePhone(params);
        ctx.body = change;
    }
}
module.exports = dlqcenter;